﻿@model EditUserViewModel

@{
    ViewBag.Title = "管理-编辑用户";
}

    <h1>编辑用户</h1>

    <form asp-action="EditUser" method="post">
        <div class="form-group row">
            <label asp-for="Id" class="col-sm-2 col-form-label"></label>
            <div class="col-sm-10">
                <input asp-for="Id" class="form-control" disabled />
            </div>
        </div>

        <div class="form-group row">
            <label asp-for="Email" class="col-sm-2 col-form-label"></label>
            <div class="col-sm-10">
                <input asp-for="Email" class="form-control" placeholder="请输入邮箱名称" />
                <span asp-validation-for="Email" class="text-danger"></span>
            </div>
        </div>

        <div class="form-group row">
            <label asp-for="UserName" class="col-sm-2 col-form-label"></label>
            <div class="col-sm-10">
                <input asp-for="UserName" class="form-control" placeholder="请输入用户名" />
                <span asp-validation-for="UserName" class="text-danger"></span>
            </div>
        </div>

        <div class="form-group row">
            <label asp-for="City" class="col-sm-2 col-form-label"></label>
            <div class="col-sm-10">
                <input asp-for="City" class="form-control" placeholder="请输入城市名称" />
                <span asp-validation-for="City" class="text-danger"></span>
            </div>
        </div>

        <div asp-validation-summary="All" class="text-danger"></div>

        <div class="form-group row">
            <div class="col-sm-10">
                <button type="submit" class="btn btn-primary">更新</button>
                <a class="btn btn-primary" asp-action="ListUsers">取消</a>
            </div>
        </div>

        <div class="card">
            <div class="card-header">
                <h3>用户角色</h3>
            </div>
            <div class="card-body">
                @if (Model.Roles.Any())
                {
                    foreach (var item in Model.Roles)
                    {
                        <h5 class="card-title">@item</h5>
                    }
                }
                else
                {
                    <h5 class="card-title">目前没有信息</h5>
                }
            </div>

            <div class="card-footer">
                <a asp-controller="Admin" asp-action="ManageUserRoles" asp-route-userId="@Model.Id" class="btn btn-primary" style="width: auto">管理角色</a>
            </div>
        </div>

        <div class="card mt-3">
            <div class="card-header">
                <h3>用户声明</h3>
            </div>
            <div class="card-body">
                @if (Model.Claims.Any())
                {
                    foreach (var item in Model.Claims)
                    {
                        <h5 class="card-title">@item</h5>
                    }
                }
                else
                {
                    <h5 class="card-title">目前没有信息</h5>
                }
            </div>

            <div class="card-footer">
                <a asp-controller="Admin" asp-action="ManageUserClaims" asp-route-userId="@Model.Id" class="btn btn-primary" style="width: auto">管理声明</a>
            </div>
        </div>

    </form>